#include "Box.h"
#include "Logger.h"


Box::Box(float w, float h, float d, unsigned char*  c, float *m)
{
    
  if (m)
    {
        for (int i = 0; i < 4 * 4; ++i)
        {
            _m[i] = m[i];
        }
    }
    else
    {
        for (int i = 0; i < 4 * 4; ++i)
        {
            _m[i] = 0.0;
        }

        _m[0] = 1.0;
        _m[5] = 1.0;
        _m[10] = 1.0;
        _m[15] = 1.0;
    }
    color[0] = c[0];
    color[1] = c[1];
    color[2] = c[2];

    this->width = w;
    this->height = h;
    this->depth = d;

}

void Box::renderInLocalFrame() const
{
        //Logger::log("Box scale is: %f %f %f", width, height, depth);
    glScalef(width,height,depth);
    glColor3ubv(color);
    glutSolidCube(1);
}    
